diff -Naur --exclude '*~' netcat-openbsd-1.89.orig/Makefile netcat-openbsd-1.89.orig-Makefile/Makefile
--- netcat-openbsd-1.89.orig/Makefile	2001-09-02 20:45:41.000000000 +0200
+++ netcat-openbsd-1.89.orig-Makefile/Makefile	2009-01-16 22:46:20.000000000 +0100
@@ -1,6 +1,21 @@
 #	$OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
 
 PROG=	nc
-SRCS=	netcat.c atomicio.c socks.c
+SRCS=   netcat.c atomicio.c socks.c \
+	        openbsd-compat/base64.c openbsd-compat/readpassphrase.c
 
-.include <bsd.prog.mk>
+CC = gcc
+override CFLAGS += `pkg-config --cflags glib-2.0`
+INC = -Iopenbsd-compat
+LIBS = `pkg-config --libs glib-2.0`
+OBJS = $(SRCS:.c=.o)
+
+all: nc
+nc: $(OBJS)
+	$(CC) $(LIBS) $(OBJS) -o nc
+
+$(OBJS): %.o: %.c
+	$(CC) $(CFLAGS) $(INC) -c $< -o $@
+
+clean:
+	rm -f $(OBJS) nc
